package com.cefa.finance.dao;

import com.cefa.finance.model.FileContractBlockData;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@SuppressWarnings("ALL")
@Repository
@Transactional
public interface FileContractBlockDataRepository extends CrudRepository<FileContractBlockData, Long> {

    @Query(value = "select * from cefa_finance_file_block_data where contract_id =?1", nativeQuery = true)
    List<FileContractBlockData> findByContractId(Long id);


    @Query(value = "select * from cefa_finance_file_block_data where contract_id =?1 and block_status is not TRUE", nativeQuery = true)
    List<FileContractBlockData> findByBlockStatus(Long id);
}
